import requests


def platform_login(base_host):
    # 登录（会话cookie保持）
    session = requests.session()
    url = base_host + "/ajax/Mysoft.PubPlatform.Nav.Handlers.LoginHandler/Login"
    data = {
        "lt": "password",
        "u": "admin",
        "p": "hn6sfuT5NBpQEVPbCmOnEt1eB+eWF5ADWu2etaB9hhs4xcEVlie4hN/HzwFrpb5bxNFuQh7HDMmwcvjDzZl0tg1tqsY4XbWHLRGX0DsmNZYc7pI166jHCV6erzH7ovdAPSq4GFqn5xU9iNp5HneGtmt4gP1HgputB05muvsx244=",
        "t": "true",
        "tenantName": "mysoft",
        "tandLog": "true"
    }
    session.post(url, data=data)
    # 获取页面公共元数据
    resp = session.get(base_host + "/api/Mysoft.Map6.Modeling.Controls.Mobile.PageAppService/GetPageCommonData")
    print(resp.json())
